

INSERT INTO Region(RegionSize,Location,Name) VALUES (500,1,'TestRegion');
INSERT INTO Region(RegionSize,Location,Name) VALUES (1000,2,'StupidRegion');
INSERT INTO Species(CommonName,ScientificName,HungerIndex,MinHeat,MaxHeat) VALUES ('Mark','Homo Markus',100,0,100);
INSERT INTO Species(CommonName,ScientificName,HungerIndex,MinHeat,MaxHeat) VALUES ('Chandler','Homo Chandler',50,0,100);
INSERT INTO User( Email, Password ) VALUES ( 'Mark', 'Jenne' );
INSERT INTO User( Email, Password ) VALUES ( 'Chandler', 'Kent' );
INSERT INTO Species_LiveIn( Species_ID, Region_ID, Population, User_ID ) VALUES ( 1, 1, 501, 1 );
INSERT INTO Species_LiveIn( Species_ID, Region_ID, Population, User_ID ) VALUES ( 2, 1, 301, 1 );

delimiter //
CREATE PROCEDURE displayPopulationProjectDemo(sid INT, usid INT)
BEGIN
	SELECT Region.Name, Species_LiveIn.Population
	FROM Region, Species_LiveIn
	WHERE Region.Region_ID = Species_LiveIn.Region_ID AND Species_LiveIn.Species_ID = sid AND User_ID = usid;
END;
//

CREATE PROCEDURE displayRegionsProjectDemo()
BEGIN
	DECLARE @test INT;
	SELECT Location, Name
	FROM Region;
END;
//
DROP PROCEDURE displayRegionsProjectDemo;
//

CREATE PROCEDURE decrementTimeOnEvents(usid INT)
BEGIN
	UPDATE Region_Has_EnvironmentEvent
	SET Duration = Duration - 1
	WHERE User_ID = usid;
END;
//

CREATE PROCEDURE addSpeciesToRegionProjectDemo(sid INT, rid INT, usid INT, population INT)
BEGIN
	INSERT INTO Species_LiveIn( Species_ID, Region_ID, User_ID, Population )
	VALUES ( sid, rid, usid, population );
END;
//

delimiter ;